package com.youku.happy.hsf.anchor;

import com.youku.happy.domain.anchor.repository.AnchorCoverRepository;
import com.youku.happy.hsf.Result;
import com.youku.happy.hsf.api.anchor.CoverUploadLimitHsfService;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * 主播身份证黑名单服务
 *
 * @author fengsu
 * @date 2021/8/18
 */
@Slf4j
@DubboService(interfaceClass = CoverUploadLimitHsfService.class, version = "1.0.0", group = "HSF", timeout = 3000)
public class CoverUploadLimitHsfProvider implements CoverUploadLimitHsfService {

    @Autowired
    private AnchorCoverRepository anchorCoverRepository;

    @Override
    public Result<Integer> getLeftUploadTime(long yid) {
        if (yid <= 0) {
            return Result.error("参数无效");
        }
        int leftUploadTime = anchorCoverRepository.getLeftUploadTime(yid);
        return Result.success(leftUploadTime);
    }
}
